package com.lyl.momanapp.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;

import com.lyl.momanapp.R;
import com.lyl.momanapp.adapter.GuidePagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by XPS on 2017/9/12.
 *  startActivity(new Intent(SlashActivity.this, MainActivity.class));
 finish();
 */

public class SlashActivity extends CheckPermissionsActivity  {
    private List<View> views;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_slash);
        setSubView();

    }
    protected void setSubView() {
        views = new ArrayList<View>();
        LayoutInflater inflater = LayoutInflater.from(this);

        //把引导页加入到集合中
        views.add(inflater.inflate(R.layout.view_guide_01, null));
        views.add(inflater.inflate(R.layout.view_guide_02, null));
        views.add(inflater.inflate(R.layout.view_guide_03, null));
        views.add(inflater.inflate(R.layout.view_guide_04, null));

        GuidePagerAdapter guidePagerAdapter = new GuidePagerAdapter(views, this);
        ((ViewPager)findViewById(R.id.viewpager_guide)).setAdapter(guidePagerAdapter);
    }

}
